#pragma once

#include "types.h"
#include <gl/glew.h>

namespace Hope {

    class OGLRenderBuffer
    {
    public:
        OGLRenderBuffer(GLenum target, GLenum usage, uint32_t size);

        ~OGLRenderBuffer();

        void SetData(const void *data);

        void DeleteBuffer();

        void Active();

        void UpdateBuffer(uint32_t offset, uint32_t size, const void* data);

        bool IsVaild() { return m_vbo == 0; }

        uint32_t GetSize() { return m_size; }

    private:
        GLuint m_vbo{0};
        GLenum m_target{0};
        GLenum m_usage{ 0 };

        uint32_t m_size{0};
    };

}